Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Interfaces remapping for controllers #1667

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

saikishor
Copy link
Member

This PR aims to add a new features to the controllers so that they will be able to remap interfaces, this would be interesting to have as for interfaces such as effort the hardware could expose more meaningful interfaces such as torque, force or current and it would get the logic of the controller more complicated if they need to support multiple type of interfaces. Instead the users should be able to remap as simply by defining the remapping definition under the controller's parameters

controller_joint2:
  ros__parameters:
    type: "controller_manager/test_controller_with_interfaces"
    joint_name: "joint2"
    remap:
      state_interfaces:
        "joint2/effort": "joint2/torque"
      command_interfaces:
        "joint2/effort": "joint2/torque"

The controller prints some more explicit log when configuring the controller, so that the user are clear on what interfaces are being remapped

1: [INFO] [1723486187.875195738] [test_controller_manager]: Configuring controller 'controller_joint3'
1: [WARN] [1723486187.875569719] [controller_joint3]: The controller : controller_joint3 will remap the following state interfaces:
1: [WARN] [1723486187.875584819] [controller_joint3]: 	'joint3/effort' to 'joint3/force'
1: [WARN] [1723486187.875615433] [controller_joint3]: The controller : controller_joint3 will remap the following command interfaces:
1: [WARN] [1723486187.875621793] [controller_joint3]: 	'joint3/effort' to 'joint3/force'

Related to ros-controls/roadmap#61

Copy link

codecov bot commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 95.72650% with 5 lines in your changes missing coverage. Please review.

Project coverage is 86.97%. Comparing base (9e57adf) to head (a3ef839).
Report is 1 commits behind head on master.

Files Patch % Lines
...roller_interface/src/controller_interface_base.cpp 85.71% 0 Missing and 4 partials ⚠️
controller_manager/src/controller_manager.cpp 95.23% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1667      +/-   ##
==========================================
+ Coverage   86.81%   86.97%   +0.16%     
==========================================
  Files         116      117       +1     
  Lines       10692    10785      +93     
  Branches      978      997      +19     
==========================================
+ Hits         9282     9380      +98     
+ Misses       1059     1047      -12     
- Partials      351      358       +7     
Flag Coverage Δ
unittests 86.97% <95.72%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...controller_interface/controller_interface_base.hpp 87.50% <ø> (ø)
...ger/include/controller_manager/controller_spec.hpp 100.00% <100.00%> (ø)
...ller_manager/test/test_controller_manager_srvs.cpp 99.26% <100.00%> (ø)
...ith_interfaces/test_controller_with_interfaces.cpp 100.00% <100.00%> (+20.00%) ⬆️
...ith_interfaces/test_controller_with_interfaces.hpp 100.00% <100.00%> (ø)
...ler_manager/test/test_hardware_management_srvs.cpp 98.56% <ø> (ø)
...ontroller_manager/test/test_release_interfaces.cpp 92.30% <100.00%> (+4.80%) ⬆️
...ace_testing/test/test_components/test_actuator.cpp 92.85% <100.00%> (+1.19%) ⬆️
...e_interface_testing/test/test_resource_manager.cpp 99.32% <ø> (ø)
controller_manager/src/controller_manager.cpp 77.49% <95.23%> (-0.20%) ⬇️
... and 1 more

... and 2 files with indirect coverage changes

Copy link
Contributor

mergify bot commented Aug 21, 2024

This pull request is in conflict. Could you fix it @saikishor?

Copy link
Contributor

mergify bot commented Aug 26, 2024

This pull request is in conflict. Could you fix it @saikishor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant